

#ifndef __BATTARY_H
#define __BATTARY_H


#include <string.h>

#include "BattaryDriver.h"


#define POWER_FROM_BATTARY 0
#define POWER_FROM_EXTERN 1

typedef struct
{
	unsigned short int VoltValue;
	unsigned char percent;
}StructBattary;

typedef struct
{
	unsigned char QuentityPercent;
	unsigned char BattaryFlag;
}StructBattaryRunPara;

extern StructBattaryRunPara gsBattaryRunPara;

void GetBattaryPower(void);
void CheckExternVolt(void);

void CalculateBattaryPowerPercent(unsigned short int Vlt);
unsigned char BinarySearch(const StructBattary *ptr,unsigned short int Value,unsigned char num);

void TestBattary(void);

#endif

